Repository navigation
Conversation
houko
force-pushed
the
feat/editor-reference-images-1027
branch
from
November 26, 2026 11:17
4979b3e to
7c41a56
Compare
houko
force-pushed
the
feat/editor-reference-images-1027
branch
from
November 26, 2026 12:04
7c41a56 to
b6f53ea
Compare
houko
force-pushed
the
feat/editor-reference-images-1027
branch
from
November 26, 2026 12:30
b6f53ea to
14986e1
Compare
…f.yaml schema interop, caps, undo guard, and CLI delivery
houko
force-pushed
the
feat/editor-reference-images-1027
branch
from
November 26, 2026 13:00
14986e1 to
3ff2ca6
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements attaching PNG, JPEG, and WebP reference images to Agent composer requests and pinning them to the project's
brief.yaml, matchingdocs/design/editor/Sketch.dc.html(Paste or drop an image, Pin to brief) using exclusivelydocs/design/editor/Spec.dc.htmltokens.Closes #1027.
Key changes
packages/game/editor/agent_references.go,agent.go,agent_runner_desktop.go,state.go,commands.go):DecodeAgentReferenceImage, usingimage/png,image/jpeg, andgolang.org/x/image/webp) under bounded size and pixel limits; unsupported types (GIF, SVG, BMP, PDF, text, or corrupted files) are refused with an explicit reason.OnFileDragEnter,OnFileDragLeave,OnFileDrop→DropAgentReferenceFiles), composer paste (core.Input.OnPaste→HandleAgentComposerPaste, plusPasteAgentReferenceImagewith injectableReadClipboardImage/ReadClipboardFileshooks), and the composer attach button (PickAndAttachAgentReferenceImages/CmdAttachReferenceImagewith injectablePickAgentReferenceFiles).AgentRequest(AttachedImages,BriefImages,Images) andAgentTurn(Images):SubmitAgentPromptsnapshots one-shot attachments and pinnedbrief.yamlreferences (deduplicated by path) and immediately clears one-shot attachments so the next request never carries them.packages/game/editor/agent_references.go,agent_references_ui.go,agent_ui.go):PinAgentReferenceImageexecutes an atomicfallibleCommand(pinReferenceImageCmd) onEditor.Historythat copies the image toart/reference/<name>(disambiguating filename collisions without overwriting different files), appends- path: art/reference/<name>(plus optionalnote:) underart.referencesinbrief.yamlviayaml.NodeAST editing (preserving existing keys and comments), refreshes the project file index and Changes/Review panel, and shows the Pin to brief confirmation card with a monospace+YAML diff and Undo button.art/reference/<name>and the addedbrief.yamlentry (or removes a freshly createdbrief.yamland emptyart/reference/directory); Redo restores both cleanly.brief.yamlchip with pinned reference count and hover preview, and user turn thumbnail strip—styled strictly withSpecPalettetokens in both Dark and Light appearances.packages/game/editor/locales/{en,zh}.yaml.docs/en/editor.mdanddocs/zh/editor.md.changelog.d/editor-reference-images-1027.mdand.agents/notes/implemented/feature/2026-11-26-editor-agent-reference-images.md.Verification
env -u GOROOT go tool nsgo check ./editorandenv -u GOROOT go tool nsgo check -target ios ./editor(passed)env -u GOROOT go tool nsgo check ./editor/editorcmdandenv -u GOROOT go tool nsgo check -target ios ./editor/editorcmd(passed)TMPDIR=/tmp env -u GOROOT go tool nsgo test ./editor -run 'TestLocaleCatalogsComplete|TestAgent|TestConnectDialog|TestBuildCLIArgs|TestDesktopMenuBarMatchesRegistryAndExecutesActions'(16 passed)TMPDIR=/tmp env -u GOROOT go tool nsgo test ./editor/editorcmd -run TestAgentReferenceImagesMacOSScreenshots(passed headless)TMPDIR=/tmp env -u GOROOT go tool nsgo test -target macos -screenshots .nsgo/test/screenshots/macos -run TestAgentReferenceImagesMacOSScreenshots ./editor/editorcmd— captured and visually inspected all 4 macOS screenshots (composer-attached-preview,composer-drop-zone,composer-pinned-diff,composer-refused-type) besideSketch.dc.html, then removed temporary PNGsbun run verify-notesandenv -u GOROOT go run ./tools/changelog check(passed)